package UserUI;

import loginUI.LoginFrame;
import frameUI.ShowFrame;
import userManageUI.CancelAccountFrame;
import userManageUI.ChangePassWordFrame;
import userManageUI.RegisterAccountFrame;

import userManageUI.UserInfoFrame;
import VO.UserVO;

public class AdminController {
	private static UserVO userVO;
	private static AdminFrame adminFrame;
	private static RegisterAccountFrame registerAccountFrame;
	private static CancelAccountFrame cancelAccountFrame;
	private static ChangePassWordFrame changePassWordFrame;
	private static UserInfoFrame userInfoFrame;
	
	public AdminController(UserVO userVO){
		this.userVO = userVO;
		adminFrame = new AdminFrame(this.userVO);
		registerAccountFrame = new RegisterAccountFrame(this.userVO);
		changePassWordFrame = new ChangePassWordFrame(this.userVO);
	}
	public AdminController(){
		
	}
	
	public static void jumpTo(String frame){
		switch(frame){
		case"login":
			new LoginFrame().setVisible(true);break;
		case"main":
			adminFrame.setVisible(true);break;
		case"registerAccountFrame":
			registerAccountFrame.setVisible(true);break;
		case"cancelAccountFrame":
			cancelAccountFrame = new CancelAccountFrame(userVO) ;
			cancelAccountFrame.setVisible(true);break;
		case"userInfoFrame":
			userInfoFrame = new UserInfoFrame(userVO) ;
			userInfoFrame.setVisible(true);break;
		case"changePassWordFrame":
			changePassWordFrame.setVisible(true);break;
		
		}
	}
}
